/** @format */

import { createWebHashHistory, createRouter } from "vue-router";

import tabar from "@/layout/tabar";
import notabar from "@/layout/notabar";

const routes = [
    {
        path: "/",
        component: tabar,
        meta: {
            title: "首页",
            id: "0",
            isActive: false,
            isshow: true,
        },
        children: [
            {
                path: "/home",
                name: "home",
                component: () => import("@/view/home/index"),
                meta: {
                    title: "首页",
                    id: "1",
                    isActive: false,
                    isshow: true,
                },
            },
            {
                path: "/mypicture",
                name: "mypicture",
                component: () => import("@/view/mypicture/index"),
                meta: {
                    title: "我的图库",
                    id: "4",
                    isActive: false,
                    isshow: true,
                },
            },
            {
                path: "/personal",
                name: "personal",
                component: () => import("@/view/mine/index"),
                meta: {
                    title: "个人中心",
                    id: "2",
                    isActive: false,
                    isshow: true,
                },
            },
            {
                path: "/friend",
                name: "friend",
                component: () => import("@/view/friend/index.vue"),
                meta: {
                    title: "我的好友",
                    id: "8",
                    isActive: false,
                    isshow: true,
                },
            },
        ],
        redirect: "/login",
        // redirect: '/demo',
    },
    {
        path: "/",
        component: notabar,
        children: [
            {
                path: "/about",
                name: "about",
                component: () => import("@/view/home/index"),
            },
            {
                path: "/login",
                name: "login",
                component: () => import("@/view/login/index.vue"),
            },
        ],
        redirect: "/login",
    },
];
const router = createRouter({
    history: createWebHashHistory(),
    routes,
});

export default router;
